
<script type="text/javascript" src="__PUBLIC__/Js/jgsat.js"></script>
<div id="msg"></div>
<form name="myform" id="myform" action="<if condition="$action_name=='add'">{:U($module_name.'/insert')}<else />{:U($module_name.'/update')}</if>&iscreatehtml=1" method="post">
<div id="filelist" class="hide"></div>
<div class="error"><ul></ul></div>

<table cellpadding=0 cellspacing=0 class="table_form" width="100%">
          
         <?php if(empty($vo['catid'])){ 
              $vo['catid']=$_GET['catid'];
         }?>
              {if $vo['catid']=="1"}  
                 <tr>
					<td width="10%" ><font color="red">*</font>设计师id</td>
					<td width="90%" id="box_userid">
					<input type="text" onBlur="check(this);"   class="input-text " name="userid"   value="{$vo['userid']}" size=""  validate=" required:true, " /> 					                    
                    </td>
				 </tr>
                 <tr>
					<td width="10%" ><font color="red">*</font>设计师名字</td>
					<td width="90%" id="box_username">
					<input type="text"  class="input-text " name="username"   value="{$vo.username}" size=""  validate=" required:true, " /> 					                    
                    </td>
				 </tr>
                {/if}
		<volist name="fields" id="r">
          <if condition="!empty($r['status'])">
			  {if $r['field']=="itemType"}
			  <tr>
				  <td width="10%">类型</td>
				  <td width="90%" ><select name="itemType">
					  <option value="">请选择</option>
					  <YP:list name="Label" where="genre=17" id="r" limit="50">
						  <?php $seled = $vo['itemType'] == $r['id'] ? 'selected="selected"' : '';?>
						  <option value="{$r['id']}" {$seled}>{$r['title']}</option>
					  </YP:list>
				  </select>

				  </td>
			  </tr>
              {elseif $r['field']=="style"}
				  <tr>
					  <td width="10%">风格</td>
					  <td width="90%" >
						  <select name="style">
							  <option value="">请选择</option>
							  <YP:list name="Label" where="genre=21" id="r" limit="50">
								  <?php $seled = $vo['style'] == $r['id'] ? 'selected="selected"' : '';?>
								  <option value="{$r['id']}" {$seled}>{$r['title']}</option>
							  </YP:list>
						  </select>

					  </td>
				  </tr>
                 {elseif $r['field']=="status" && $vo['catid']=='1'}
                      <tr>
                          <td width="10%" >状态</td>
                          <td width="90%" id="box_status"><label style="float:left;width:75px" class="checkbox_status" >
                           {if $vo[status]!=0}已审核{/if}
                              </label>
                             <label style="float:left;width:75px" class="checkbox_status" >
                            {if $vo[status]==0}未审核{/if} 
                             </label>
                          </td>
                    </tr>
                 
			  {elseif $r['field']=="budget" && $vo['catid']=='2'}
               

			  {elseif $r['field']=="itemArea" && $vo['catid']=='2'}
                

	          {elseif $r['field']=="pic" && $vo['catid']=='2'}

                <tr>
					<td width="10%" ><if condition="$r['required']"><font color="red">*</font></if>首页推荐图(590*300)</td>
					<td width="90%" id="box_{$r['field']}">
					{$r|getform=$form,###}
					</td>
				</tr>

			  {elseif $r['field']=="thumb_list" && $vo['catid']=='2'}

                <tr>
					<td width="10%" ><if condition="$r['required']"><font color="red">*</font></if>缩略图(258*220)</td>
					<td width="90%" id="box_{$r['field']}">
					{$r|getform=$form,###}
					</td>
				</tr>

			  {elseif $r['field']=="pics" && $vo['catid']=='2'}

                <tr>
					<td width="10%" ><if condition="$r['required']"><font color="red">*</font></if>作品图片(808*690	)</td>
					<td width="90%" id="box_{$r['field']}">
					{$r|getform=$form,###}
					</td>
				</tr>

			
              
               {elseif $r['field']=="catid" }

               <input type="hidden" name="catid"  value="{$vo['catid']}"/>

			  {else}
              



				<tr>
					<td width="10%" ><if condition="$r['required']"><font color="red">*</font></if>{$r.name} </td>
				<td width="90%" id="box_{$r['field']}">
					{$r|getform=$form,###}
					</td>
				</tr>
			  {/if}
		</if>

		</volist>
</table>
<div id="bootline"></div>
<div id="btnbox" class="btn">
<if condition="$vo['id']!=''"><input TYPE="hidden" name="id" value="{$vo.id}"></if>
<input type="hidden"  name="lang" value="{$langid}" />
<input type="hidden" name="forward" value="{$_SERVER['HTTP_REFERER']}" />
<INPUT TYPE="submit"  value="{:L('dosubmit')}" id="subbnt" class="button" >
<input TYPE="reset"  value="{:L('cancel')}" class="button">
</div>
</form>
</div>
<script>
function check(obj){
   
   var val = obj.value;
   $("#delbb").remove();
   //alert (val);
$.post('index.php?g=Admin&m=Index&a=user_id', {'id':val },function(res){
	
			 if(res==0){
				 $("#subbnt").attr({"disabled":"disabled"});
				   $("#box_userid").append('<b id="delbb">不正确的设计师ID</b>')
				  }
			if(res==1){
				$("#subbnt").removeAttr("disabled");
				  }	 
           });
}

</script>                                                                                                                                                                                                                                                                                                                                                                                                                                                